<template>
	<!-- 未在业务流程中 -->
	<!--  移动端 我的待评价评价  -->
	<view class="page">
		<view class="evaluate-goods">
			<view class="list">
				<view class="picture">
					<image src="/static/logo.png"></image>
				</view>
				<view class="item">
					<view class="title">
						<text>订单评价:&nbsp;</text>
					</view>
					<view class="star-list">
						<view class="hint">
							<text>总体评价</text>
						</view>
						<view class="star">
							<u-rate :count="count" v-model="value"></u-rate>
						</view>
						
					</view>
				</view>
			</view>
		</view>
		<!--填写-->
		<view class="input-info">
			<view class="input-title">
				<text>分享你的使用体验吧</text>
			</view>
			<view class="input-text">
				<textarea v-model="input" placeholder="感觉怎么？跟大家分享一下吧~"></textarea>
				<!-- <view class="record-text">
          <text>已写</text>
          <text class="ac">12</text>
          <text>个字</text>
        </view> -->
			</view>
			<!-- <view class="anonymous">
        <radio class="radio" :checked="isChecked" color="red" style="transform:scale(0.7)"></radio>
        <text>匿名评价</text>
      </view> -->
		</view>
		<!--上传图片-->
		<!-- <view class="upload-img">
      <view class="img-title">
        <text>上传图片/视频</text>
      </view>
      <view class="img-list">
        <view class="list up-img">
          <image src="/static/up_video.png"></image>
        </view>
        <view class="list up-img">
          <image src="/static/up_img.png"></image>
        </view>
        <view class="list">
          <image src="/static/img/goods_thumb_01.png"></image>
          <text class="iconfont icon-close1"></text>
        </view>
        <view class="list">
          <image src="/static/img/goods_thumb_01.png"></image>
          <text class="iconfont icon-close1"></text>
        </view>
      </view>
    </view> -->
		<!--提交-->
		<view class="submit-btn">
			<view class="btn" @click="add">
				<text>提交</text>
			</view>
		</view>
	</view>
</template>

<script>
	import {baseUrl} from '@/config/baseUrl.js'
	export default {
		data() {
			return {
				isChecked: false,
				count: 5,
				value: 5,
				input:"",
				orderNO:'',
			};
		},
		onLoad(option) {
			this.orderNO = option.orderNo
		},
		methods:{
			add(){
				uni.request({
					// 192.168.2.111 本机ip  localhost
					url:  baseUrl+"/userOrder/evaluate",
					method: 'POST',
					data: {
						orderNo: this.orderNO,
						evaluate: this.input,
						evaluateNum: this.value,
					},
					header:{ "Content-Type": "application/x-www-form-urlencoded"},
					success: (res) => {
						console.log(res)
						 if(res.data>0){
							 uni.showToast({
							 	title: "评价成功",
							 	icon: "none"
							 })
							 uni.navigateTo({
							 	url: '/pages/MyOrderList/MyOrderList',
							 })
						 }else{
							uni.showToast({
								title: "评价失败,请检查网络",
								icon: "none"
							}) 
						 }
					}
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	@import "MyEvaluatePush.scss";
</style>
